/*
 * @Author: zhangweixin 
 * @Date: 2018-11-07 16:37:09 
 * @Last Modified by: zhangweixin
 * @Last Modified time: 2018-11-21 20:02:42
 */
const express = require("express");
const  app = express();

// 文档https://github.com/bripkens/connect-history-api-fallback
var history = require("connect-history-api-fallback");
app.use(history());

// 启动node进程携带的变量
// 只设置一次有效 $ port=2000 node server.js
// 设置永久有效  $ export port=1234
const port = process.env.port || 8080;

app.use(express.static(__dirname+"/dist"));

app.listen(port,(err)=>{
  if(err){
    console.log(err)
  }
  console.log("listening port "+port)
});